# print('Hello World')  ctrl + / 快捷键注释

# 单行注释

"""
多行注释

"""
# 整数 int
# int1 = 666
# print(type(int1))  # 输入的时候可以先输入 type(int1).print 回车就自动加上了
#
# # 浮点数 float
# float1 = 10.1
# print(type(float1))
# float2: float = 9.9  # 明确指定当前变量float2的类型为float，主要用于代码中的判断
#
# # 布尔 bool
# bool1 = False
# print(type(bool1))
#
# # 字符串 String
# str1 = "Hello World"
# print(type(str1))
#
# # 列表 List
# list1 = ['111', 'Python', 10.2, True, '张三']
# print(type(list1))
#
# # 元组 Tuple
# tuple1 = ('111', 'Python', 222, '张三')
# print(type(tuple1))
#
# # 集合 Set
# set1 = {111, 'Python', 111, 'Python'}
# print(type(set1))
# # Set 无序不可重复，输出：{'Python', 111}
# print(set1)
#
# # 字典 Dictionary
# dict1 = {'name': 'runoob',
#          'code': 6734,
#          'dept': 'sales'}
# print(type(dict1))

# name = input('请输入你的姓名：')
# print(name)
# print(type(name))

# # 输入类型转换
# # 数字转字符串
# age = 16
# print(type(age))
# age_str = str(age)
# print(type(age_str))
#
# # 字符串转数字
# age_int = int(age_str)
# print(type(age_int))


# 输出格式化
# my_name = '张三'
# my_age = 23
# my_city = 'beijing'
#
# print('我的名字是%s' % my_name)
# print('我的名字是%s，我的年龄是%d' % (my_name, my_age))
# print('我的名字是%s，我的年龄是%s' % (my_name, my_age))
# print('我的名字是%s，我的年龄是%s，我所在的城市是%s' % (my_name, my_age, my_city))

# 特殊的格式
# money = 999
# num1 = 1.71
# num2 = 1.78
# print('我的钱是:%4d' % money)
# # 精确到小数点后1位
# print('%.1f' % num1)
# print('%.1f' % num2)  # python中小数会四舍五入
# # 精确到小数点后3位
# print('%.3f' % num2)

# num3 = 22.345
# # 精确到小数点后2位：正确的是22.35，实际输出22.34
# print('%.2f' % num3)
#
# # 精确的四舍五入
# from decimal import Decimal
#
# num4 = Decimal(str(num3)).quantize(Decimal('0.00'),rounding='ROUND_HALF_UP')
# print(num4)

# my_name = '张三'
# my_age = 23
# my_city = 'beijing'
#
# print(f'我的名字是{my_name}，我的年龄是{my_age + 1}，我所在的城市是{my_city}')

# print('加法：%d' % (1 + 1))
# print('减法：%d' % (1 - 1))
# print('乘法：%d' % (2 * 2))
# print('除法：%d' % (10 / 2))
# print('整除：%d' % (9 // 4))
# print('取余数：%d' % (9 % 4))
# print('指数：%d' % (2 ** 4))
# print('括号：%d' % ((1 + 2) * 3))
#
# print(f'2的3次方：{pow(2, 3)}')
# print(f'6的立方根：{pow(6, 1 / 3)}')

# c = 1
# a = 2
# c += a  # c = c+a
# print(c)
#
# x = 11
# x += 2 * 4  # x = x + 2*4  先计算后赋值
# print(x)

# # 比较运算符
# x = 11
# y = 12
# print(f'判断等于：{x == y}')
# print(f'判断不等于：{x != y}')
# print(f'判断小于：{x < y}')
# print(f'判断大于：{x > y}')
# print(f'判断大于等于：{x >= y}')
# print(f'判断小于等于：{x <= y}')

# # 逻辑运算符
# x = False
# y = True
#
# print(f'and逻辑运算符：{x and y}')
# print(f'or逻辑运算符：{x or y}')
# print(f'not逻辑运算符：{not x}')


